#include <stdio.h>
#include <conio.h>
int rnd(int *seed){
  long long a;
  a=(long long)16807**seed;
  *seed=(int)(a%2147483647);
  return *seed;
}

int main(void){
  int seed;
  int k,i,j,v=0,s;
  seed=1;
  for(k=1;k<=50;k++)
    printf("%10d\n",rnd(&seed));
  getch();
}
